let array = [1, 2, 2, 3, 4, 4, 5]
const uniqueArray = array.reduce((acc, current) => {
  if (acc.indexOf(current) === -1) acc.push(current)
  return acc
}, [])
console.log(uniqueArray)
